package ninja9.muzik.dao;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * FavoriteSingerId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class FavoriteSingerId implements java.io.Serializable {

	// Fields

	private Integer userId;
	private Integer singerId;

	// Constructors

	/** default constructor */
	public FavoriteSingerId() {
	}

	/** full constructor */
	public FavoriteSingerId(Integer userId, Integer singerId) {
		this.userId = userId;
		this.singerId = singerId;
	}

	// Property accessors

	@Column(name = "user_id", nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "singer_id", nullable = false)
	public Integer getSingerId() {
		return this.singerId;
	}

	public void setSingerId(Integer singerId) {
		this.singerId = singerId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof FavoriteSingerId))
			return false;
		FavoriteSingerId castOther = (FavoriteSingerId) other;

		return ((this.getUserId() == castOther.getUserId()) || (this
				.getUserId() != null && castOther.getUserId() != null && this
				.getUserId().equals(castOther.getUserId())))
				&& ((this.getSingerId() == castOther.getSingerId()) || (this
						.getSingerId() != null
						&& castOther.getSingerId() != null && this
						.getSingerId().equals(castOther.getSingerId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getUserId() == null ? 0 : this.getUserId().hashCode());
		result = 37 * result
				+ (getSingerId() == null ? 0 : this.getSingerId().hashCode());
		return result;
	}

}